﻿using System;
using System.Collections.Generic;
using OpenLS.Spreadsheet.Formats.Biff.OfficeArt;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class HFPictureRecord : BiffRecord
    {
        private FrtHeader frtHeader;
        private bool fIsDrawing;
        private bool fIsDrawingGroup;
        private bool fContinue;

        protected override void ReadContent(BiffReaderContext context, int length)
        {
            this.frtHeader = new FrtHeader();
            this.frtHeader.Read(context.Reader);
            ushort abc = context.ReadByte();
            this.fIsDrawing = (abc & 0x01) != 0;
            this.fIsDrawingGroup = (abc & 0x02) != 0;
            this.fContinue = (abc & 0x04) != 0;
            context.ReadByte();
            OfficeArtReadContext oaContext = new OfficeArtReadContext(context.Reader, new Dictionary<int, ObjRecord>(), new Dictionary<int, TxORecord>() );
            if (!fIsDrawing)
            {
                OfficeArtDggContainer = new OfficeArtDggContainer();
                OfficeArtDggContainer.Read(oaContext);
            }
            else
            {
                OfficeArtDgContainer = new OfficeArtDgContainer();
                OfficeArtDgContainer.Read(oaContext);
            }
        }

        private OfficeArtDgContainer OfficeArtDgContainer;
        private OfficeArtDggContainer OfficeArtDggContainer;    

        internal override BiffRecordType RecordType
        {
            get { return BiffRecordType.HFPicture; }
        }

        internal override void WriteContent(BiffWriterWorkbookContext context)
        {
            throw new NotImplementedException();
        }
    }
}